Since various information processors are designed to be driven by their own particular machine language instructions or object code, the desire for program compatibility between processors has led to the creation of a number of higher level program languages which for the most part are machine independent. In order to accommodate such machine independent languages, the various information processors are provided with compiling routines as a part of their operating systems, which routines accept programs written in particular higher level languages and in turn compile the strings of machine language instructions or operation code to implement the particular program.
A particular higher level language adapted to the needs and requirements of business and accounting procedures is the COBOL language which name is an acronym for Common Business Oriented Language. COBOL is a general algorithm-specifying language with a structure such that instructions may be written in terms similar to terms in the English language which are readily comprehensible. It will be understood that because of the generality of this language, rather complex strings of machine instructions will have to be called forth to implement a particular COBOL instruction and that the complexity in length of such machine language strings would vary from processor to processor.
A particular higher level language which is similar in form to COBOL but which is nevertheless designed for very specific types of programming tasks such as reporting and business data file maintenance is the Report Program Generator which is more commonly known as RPG. Because of its simplicity and compactness, RPG is employed in many very small data processing systems. However, should the user decide to change to a larger data processing system for which RPG compiler is not provided, then his programs must be rewritten in the more general COBOL language or some other conversion technique must be provided.
The provision of a translation technique not only frees the user from being tied into his RPG program but it also provides the convenience of allowing the user to continue to write his programs in the more simple RPG language, where applicable for later translation into COBOL for use in a larger data processing system for which COBOL compilers are provided.
Various attempts have been made in the past to create translation or source to source conversion systems. However, because of the different meanings of a respective procedure statements as well as because of the different procedure formats, such systems were not very successful and required the user to manually correct inherent inconsistencies before he could achieve a workable program conversion. Of course, certain higher level languages such as ALGOL are so different in format and purpose from the COBOL language that conversion is not practical or even desirable. However, RPG and COBOL are similar in purpose and form so that a meaningful translation system can be realized. Yet even here, there have been sufficient differences between the two languages such that substantial reworking of the converted form is required to achieve an error free program that could be employed with the system having COBOL compiler.
It is, therefore, an object of the present invention to provide an automatic system for the translation of programs from one higher level program language to another higher level program language.
It is another object of the present invention to provide an improved translation system for the particularly accurate translation of programs from one source language to another source language even though particular statements and procedures in the respective languages differ in both form and significance.
It is still another object of the present invention to provide an improved translation system for the translation of programs from the RPG source language to the COBOL source language.